Integrand size = 21, antiderivative size = 114 \[ \int \frac {\cos (c+d x)}{\left (a+b \tan ^2(c+d x)\right )^2} \, dx=-\frac {(4 a-b) b \text {arctanh}\left (\frac {\sqrt {a-b} \sin (c+d x)}{\sqrt {a}}\right )}{2 a^{3/2} (a-b)^{5/2} d}+\frac {\sin (c+d x)}{(a-b)^2 d}+\frac {b^2 \sin (c+d x)}{2 a (a-b)^2 d \left (a-(a-b) \sin ^2(c+d x)\right )} \]
-1/2*(4*a-b)*b*arctanh(sin(d*x+c)*(a-b)^(1/2)/a^(1/2))/a^(3/2)/(a-b)^(5/2) /d+sin(d*x+c)/(a-b)^2/d+1/2*b^2*sin(d*x+c)/a/(a-b)^2/d/(a-(a-b)*sin(d*x+c) ^2)
Time = 0.44 (sec) , antiderivative size = 140, normalized size of antiderivative = 1.23 \[ \int \frac {\cos (c+d x)}{\left (a+b \tan ^2(c+d x)\right )^2} \, dx=\frac {\frac {1}{2} (4 a-b) b \text {arctanh}\left (\frac {\sqrt {a-b} \sin (c+d x)}{\sqrt {a}}\right ) (a+b+(a-b) \cos (2 (c+d x)))-\sqrt {a} \sqrt {a-b} \left (a^2+a b+b^2+a (a-b) \cos (2 (c+d x))\right ) \sin (c+d x)}{2 a^{3/2} (a-b)^{5/2} d \left (-a+(a-b) \sin ^2(c+d x)\right )} \]
(((4*a - b)*b*ArcTanh[(Sqrt[a - b]*Sin[c + d*x])/Sqrt[a]]*(a + b + (a - b) *Cos[2*(c + d*x)]))/2 - Sqrt[a]*Sqrt[a - b]*(a^2 + a*b + b^2 + a*(a - b)*C os[2*(c + d*x)])*Sin[c + d*x])/(2*a^(3/2)*(a - b)^(5/2)*d*(-a + (a - b)*Si n[c + d*x]^2))
Time = 0.34 (sec) , antiderivative size = 109, normalized size of antiderivative = 0.96, number of steps used = 5, number of rules used = 4, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.190, Rules used = {3042, 4159, 300, 2009}
Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.
\(\displaystyle \int \frac {\cos (c+d x)}{\left (a+b \tan ^2(c+d x)\right )^2} \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \frac {1}{\sec (c+d x) \left (a+b \tan (c+d x)^2\right )^2}dx\) |
\(\Big \downarrow \) 4159 |
\(\displaystyle \frac {\int \frac {\left (1-\sin ^2(c+d x)\right )^2}{\left (a-(a-b) \sin ^2(c+d x)\right )^2}d\sin (c+d x)}{d}\) |
\(\Big \downarrow \) 300 |
\(\displaystyle \frac {\int \left (\frac {1}{(a-b)^2}-\frac {(2 a-b) b-2 (a-b) b \sin ^2(c+d x)}{(a-b)^2 \left ((b-a) \sin ^2(c+d x)+a\right )^2}\right )d\sin (c+d x)}{d}\) |
\(\Big \downarrow \) 2009 |
\(\displaystyle \frac {-\frac {b (4 a-b) \text {arctanh}\left (\frac {\sqrt {a-b} \sin (c+d x)}{\sqrt {a}}\right )}{2 a^{3/2} (a-b)^{5/2}}+\frac {b^2 \sin (c+d x)}{2 a (a-b)^2 \left (a-(a-b) \sin ^2(c+d x)\right )}+\frac {\sin (c+d x)}{(a-b)^2}}{d}\) |
(-1/2*((4*a - b)*b*ArcTanh[(Sqrt[a - b]*Sin[c + d*x])/Sqrt[a]])/(a^(3/2)*( a - b)^(5/2)) + Sin[c + d*x]/(a - b)^2 + (b^2*Sin[c + d*x])/(2*a*(a - b)^2 *(a - (a - b)*Sin[c + d*x]^2)))/d
3.5.66.3.1 Defintions of rubi rules used
Int[((a_) + (b_.)*(x_)^2)^(p_)*((c_) + (d_.)*(x_)^2)^(q_), x_Symbol] :> Int [PolynomialDivide[(a + b*x^2)^p, (c + d*x^2)^(-q), x], x] /; FreeQ[{a, b, c , d}, x] && NeQ[b*c - a*d, 0] && IGtQ[p, 0] && ILtQ[q, 0] && GeQ[p, -q]
Int[sec[(e_.) + (f_.)*(x_)]^(m_.)*((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)]^(n_ ))^(p_.), x_Symbol] :> With[{ff = FreeFactors[Sin[e + f*x], x]}, Simp[ff/f Subst[Int[ExpandToSum[b*(ff*x)^n + a*(1 - ff^2*x^2)^(n/2), x]^p/(1 - ff^2 *x^2)^((m + n*p + 1)/2), x], x, Sin[e + f*x]/ff], x]] /; FreeQ[{a, b, e, f} , x] && IntegerQ[(m - 1)/2] && IntegerQ[n/2] && IntegerQ[p]
Time = 1.62 (sec) , antiderivative size = 118, normalized size of antiderivative = 1.04
method | result | size |
derivativedivides | \(\frac {\frac {\sin \left (d x +c \right )}{a^{2}-2 a b +b^{2}}+\frac {b \left (-\frac {b \sin \left (d x +c \right )}{2 a \left (\sin \left (d x +c \right )^{2} a -b \sin \left (d x +c \right )^{2}-a \right )}-\frac {\left (4 a -b \right ) \operatorname {arctanh}\left (\frac {\left (a -b \right ) \sin \left (d x +c \right )}{\sqrt {a \left (a -b \right )}}\right )}{2 a \sqrt {a \left (a -b \right )}}\right )}{\left (a -b \right )^{2}}}{d}\) | \(118\) |
default | \(\frac {\frac {\sin \left (d x +c \right )}{a^{2}-2 a b +b^{2}}+\frac {b \left (-\frac {b \sin \left (d x +c \right )}{2 a \left (\sin \left (d x +c \right )^{2} a -b \sin \left (d x +c \right )^{2}-a \right )}-\frac {\left (4 a -b \right ) \operatorname {arctanh}\left (\frac {\left (a -b \right ) \sin \left (d x +c \right )}{\sqrt {a \left (a -b \right )}}\right )}{2 a \sqrt {a \left (a -b \right )}}\right )}{\left (a -b \right )^{2}}}{d}\) | \(118\) |
risch | \(-\frac {i {\mathrm e}^{i \left (d x +c \right )}}{2 d \left (a^{2}-2 a b +b^{2}\right )}+\frac {i {\mathrm e}^{-i \left (d x +c \right )}}{2 d \left (a^{2}-2 a b +b^{2}\right )}+\frac {i b^{2} \left ({\mathrm e}^{3 i \left (d x +c \right )}-{\mathrm e}^{i \left (d x +c \right )}\right )}{d a \left (-a +b \right )^{2} \left (-a \,{\mathrm e}^{4 i \left (d x +c \right )}+b \,{\mathrm e}^{4 i \left (d x +c \right )}-2 a \,{\mathrm e}^{2 i \left (d x +c \right )}-2 b \,{\mathrm e}^{2 i \left (d x +c \right )}-a +b \right )}+\frac {b \ln \left ({\mathrm e}^{2 i \left (d x +c \right )}-\frac {2 i a \,{\mathrm e}^{i \left (d x +c \right )}}{\sqrt {a^{2}-a b}}-1\right )}{\sqrt {a^{2}-a b}\, \left (a -b \right )^{2} d}-\frac {b^{2} \ln \left ({\mathrm e}^{2 i \left (d x +c \right )}-\frac {2 i a \,{\mathrm e}^{i \left (d x +c \right )}}{\sqrt {a^{2}-a b}}-1\right )}{4 \sqrt {a^{2}-a b}\, \left (a -b \right )^{2} d a}-\frac {b \ln \left ({\mathrm e}^{2 i \left (d x +c \right )}+\frac {2 i a \,{\mathrm e}^{i \left (d x +c \right )}}{\sqrt {a^{2}-a b}}-1\right )}{\sqrt {a^{2}-a b}\, \left (a -b \right )^{2} d}+\frac {b^{2} \ln \left ({\mathrm e}^{2 i \left (d x +c \right )}+\frac {2 i a \,{\mathrm e}^{i \left (d x +c \right )}}{\sqrt {a^{2}-a b}}-1\right )}{4 \sqrt {a^{2}-a b}\, \left (a -b \right )^{2} d a}\) | \(393\) |
1/d*(1/(a^2-2*a*b+b^2)*sin(d*x+c)+b/(a-b)^2*(-1/2*b/a*sin(d*x+c)/(sin(d*x+ c)^2*a-b*sin(d*x+c)^2-a)-1/2*(4*a-b)/a/(a*(a-b))^(1/2)*arctanh((a-b)*sin(d *x+c)/(a*(a-b))^(1/2))))
Leaf count of result is larger than twice the leaf count of optimal. 207 vs. \(2 (103) = 206\).
Time = 0.34 (sec) , antiderivative size = 451, normalized size of antiderivative = 3.96 \[ \int \frac {\cos (c+d x)}{\left (a+b \tan ^2(c+d x)\right )^2} \, dx=\left [-\frac {{\left (4 \, a b^{2} - b^{3} + {\left (4 \, a^{2} b - 5 \, a b^{2} + b^{3}\right )} \cos \left (d x + c\right )^{2}\right )} \sqrt {a^{2} - a b} \log \left (-\frac {{\left (a - b\right )} \cos \left (d x + c\right )^{2} - 2 \, \sqrt {a^{2} - a b} \sin \left (d x + c\right ) - 2 \, a + b}{{\left (a - b\right )} \cos \left (d x + c\right )^{2} + b}\right ) - 2 \, {\left (2 \, a^{3} b - a^{2} b^{2} - a b^{3} + 2 \, {\left (a^{4} - 2 \, a^{3} b + a^{2} b^{2}\right )} \cos \left (d x + c\right )^{2}\right )} \sin \left (d x + c\right )}{4 \, {\left ({\left (a^{6} - 4 \, a^{5} b + 6 \, a^{4} b^{2} - 4 \, a^{3} b^{3} + a^{2} b^{4}\right )} d \cos \left (d x + c\right )^{2} + {\left (a^{5} b - 3 \, a^{4} b^{2} + 3 \, a^{3} b^{3} - a^{2} b^{4}\right )} d\right )}}, \frac {{\left (4 \, a b^{2} - b^{3} + {\left (4 \, a^{2} b - 5 \, a b^{2} + b^{3}\right )} \cos \left (d x + c\right )^{2}\right )} \sqrt {-a^{2} + a b} \arctan \left (\frac {\sqrt {-a^{2} + a b} \sin \left (d x + c\right )}{a}\right ) + {\left (2 \, a^{3} b - a^{2} b^{2} - a b^{3} + 2 \, {\left (a^{4} - 2 \, a^{3} b + a^{2} b^{2}\right )} \cos \left (d x + c\right )^{2}\right )} \sin \left (d x + c\right )}{2 \, {\left ({\left (a^{6} - 4 \, a^{5} b + 6 \, a^{4} b^{2} - 4 \, a^{3} b^{3} + a^{2} b^{4}\right )} d \cos \left (d x + c\right )^{2} + {\left (a^{5} b - 3 \, a^{4} b^{2} + 3 \, a^{3} b^{3} - a^{2} b^{4}\right )} d\right )}}\right ] \]
[-1/4*((4*a*b^2 - b^3 + (4*a^2*b - 5*a*b^2 + b^3)*cos(d*x + c)^2)*sqrt(a^2 - a*b)*log(-((a - b)*cos(d*x + c)^2 - 2*sqrt(a^2 - a*b)*sin(d*x + c) - 2* a + b)/((a - b)*cos(d*x + c)^2 + b)) - 2*(2*a^3*b - a^2*b^2 - a*b^3 + 2*(a ^4 - 2*a^3*b + a^2*b^2)*cos(d*x + c)^2)*sin(d*x + c))/((a^6 - 4*a^5*b + 6* a^4*b^2 - 4*a^3*b^3 + a^2*b^4)*d*cos(d*x + c)^2 + (a^5*b - 3*a^4*b^2 + 3*a ^3*b^3 - a^2*b^4)*d), 1/2*((4*a*b^2 - b^3 + (4*a^2*b - 5*a*b^2 + b^3)*cos( d*x + c)^2)*sqrt(-a^2 + a*b)*arctan(sqrt(-a^2 + a*b)*sin(d*x + c)/a) + (2* a^3*b - a^2*b^2 - a*b^3 + 2*(a^4 - 2*a^3*b + a^2*b^2)*cos(d*x + c)^2)*sin( d*x + c))/((a^6 - 4*a^5*b + 6*a^4*b^2 - 4*a^3*b^3 + a^2*b^4)*d*cos(d*x + c )^2 + (a^5*b - 3*a^4*b^2 + 3*a^3*b^3 - a^2*b^4)*d)]
\[ \int \frac {\cos (c+d x)}{\left (a+b \tan ^2(c+d x)\right )^2} \, dx=\int \frac {\cos {\left (c + d x \right )}}{\left (a + b \tan ^{2}{\left (c + d x \right )}\right )^{2}}\, dx \]
Exception generated. \[ \int \frac {\cos (c+d x)}{\left (a+b \tan ^2(c+d x)\right )^2} \, dx=\text {Exception raised: ValueError} \]
Exception raised: ValueError >> Computation failed since Maxima requested additional constraints; using the 'assume' command before evaluation *may* help (example of legal syntax is 'assume(b-a>0)', see `assume?` for more details)Is
Time = 0.62 (sec) , antiderivative size = 152, normalized size of antiderivative = 1.33 \[ \int \frac {\cos (c+d x)}{\left (a+b \tan ^2(c+d x)\right )^2} \, dx=-\frac {\frac {b^{2} \sin \left (d x + c\right )}{{\left (a^{3} - 2 \, a^{2} b + a b^{2}\right )} {\left (a \sin \left (d x + c\right )^{2} - b \sin \left (d x + c\right )^{2} - a\right )}} + \frac {{\left (4 \, a b - b^{2}\right )} \arctan \left (-\frac {a \sin \left (d x + c\right ) - b \sin \left (d x + c\right )}{\sqrt {-a^{2} + a b}}\right )}{{\left (a^{3} - 2 \, a^{2} b + a b^{2}\right )} \sqrt {-a^{2} + a b}} - \frac {2 \, \sin \left (d x + c\right )}{a^{2} - 2 \, a b + b^{2}}}{2 \, d} \]
-1/2*(b^2*sin(d*x + c)/((a^3 - 2*a^2*b + a*b^2)*(a*sin(d*x + c)^2 - b*sin( d*x + c)^2 - a)) + (4*a*b - b^2)*arctan(-(a*sin(d*x + c) - b*sin(d*x + c)) /sqrt(-a^2 + a*b))/((a^3 - 2*a^2*b + a*b^2)*sqrt(-a^2 + a*b)) - 2*sin(d*x + c)/(a^2 - 2*a*b + b^2))/d
Time = 15.49 (sec) , antiderivative size = 269, normalized size of antiderivative = 2.36 \[ \int \frac {\cos (c+d x)}{\left (a+b \tan ^2(c+d x)\right )^2} \, dx=\frac {\frac {\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\left (2\,a^2+b^2\right )}{a\,{\left (a-b\right )}^2}+\frac {{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^5\,\left (2\,a^2+b^2\right )}{a\,{\left (a-b\right )}^2}+\frac {2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3\,\left (-2\,a^2+4\,a\,b+b^2\right )}{a\,{\left (a-b\right )}^2}}{d\,\left (a\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^6+\left (4\,b-a\right )\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4+\left (4\,b-a\right )\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+a\right )}+\frac {b\,\mathrm {atan}\left (\frac {2{}\mathrm {i}\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,a^3-6{}\mathrm {i}\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,a^2\,b+6{}\mathrm {i}\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,a\,b^2-2{}\mathrm {i}\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,b^3}{\sqrt {a}\,{\left (a-b\right )}^{5/2}\,\left ({\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+1\right )}\right )\,\left (4\,a-b\right )\,1{}\mathrm {i}}{2\,a^{3/2}\,d\,{\left (a-b\right )}^{5/2}} \]
((tan(c/2 + (d*x)/2)*(2*a^2 + b^2))/(a*(a - b)^2) + (tan(c/2 + (d*x)/2)^5* (2*a^2 + b^2))/(a*(a - b)^2) + (2*tan(c/2 + (d*x)/2)^3*(4*a*b - 2*a^2 + b^ 2))/(a*(a - b)^2))/(d*(a - tan(c/2 + (d*x)/2)^2*(a - 4*b) - tan(c/2 + (d*x )/2)^4*(a - 4*b) + a*tan(c/2 + (d*x)/2)^6)) + (b*atan((a^3*tan(c/2 + (d*x) /2)*2i - b^3*tan(c/2 + (d*x)/2)*2i + a*b^2*tan(c/2 + (d*x)/2)*6i - a^2*b*t an(c/2 + (d*x)/2)*6i)/(a^(1/2)*(a - b)^(5/2)*(tan(c/2 + (d*x)/2)^2 + 1)))* (4*a - b)*1i)/(2*a^(3/2)*d*(a - b)^(5/2))